{include file="admin/top.php" subject='supplieProducts'}
{include file="supplieProducts/top.php" subject='supplieProducts'}
<div id="content">
<div id="boxquery">
    <form method="get">
         <input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="supplieProducts.php" />
        <input type="submit" value="查询" class="fr" />
        <ul>
        <li><div style="line-height: 15px;float:left;">产品ID:&nbsp; </div><textarea id="product_id" name="product_id" style="resize:horizontal;float:left;height:30px;">{$smarty.get.product_id}</textarea></li>
        <li>仓库:&nbsp; <select id="shopid" name="shopid" onchange="$('[shopid]').hide();$('[shopid='+this.value+']').show();"><option value="">全部</option>{shops}<option value="{$shops.id}" {if $shops.id==$smarty.get.shopid}selected{/if}>{$shops.title}</option>{/shops}</select></li>
        <li>
        	供应商:&nbsp; <select name="supplier_id">
        		<option value="">---请选择---</option>
        		{foreach from=$suppliers item=item}
        			<option value="{$item.id}" {if $item.id == $smarty.get.supplier_id}selected{/if} shopid="{$item.shopid}" >{$item.title}</option>
        		{/foreach}
        	</select>
        </li>
        <li>产品关键字:&nbsp; <input id="keywords" name="keywords" type="text" size="30" value="{$smarty.get.keywords}" />
        </li>
		<li>采购价:&nbsp; <input id="lprice" name="lprice" type="text" size="6" value="{$smarty.get.lprice}"/>-<input id="hprice" name="hprice" type="text" size="6" value="{$smarty.get.hprice}"/>
        </li>
        <li>库存:&nbsp; <input id="lstock" name="lstock" type="text" size="6" value="{$smarty.get.lstock}"/>-<input id="hstock" name="hstock" type="text" size="6" value="{$smarty.get.hstock}"/>
        </li>
        </ul>
    </form>
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="5" id="lister">
      <tr id="title">
        <td width="40">SKU_ID</td>
        <td width="40">产品ID</td>
        <td>产品图片</td>
        <td>产品名称</td>
        <td>发货仓</td>
        <td width="160">供应商(负责人)</td>
        <td>采购单价</td>
        <td>货币单位</td>
        <td>库存(余/总)</td>
        <td>默认供应商</td>
        <td>主站状态</td>
        <td>微店状态</td>
        <td>供应商状态</td>
        <td>&nbsp;</td>
      </tr>
      {supplieProducts limit=20 pager=pager page=$segment.page order="id desc" keywords=$smarty.get.keywords product_id=$smarty.get.product_id shopid=$smarty.get.shopid supplier_id=$smarty.get.supplier_id lprice=$smarty.get.lprice hprice=$smarty.get.hprice lstock=$smarty.get.lstock hstock=$smarty.get.hstock}
      {if $pager->rows>0}
          <tr id="content">
            <td>{$products.product_sku_id}</td>
            <td>{$products.pid}</td>
            <td height="50">{if $products.product_pic}<img src="{$products.product_pic}" width="50" height="50" />{else}暂无图片{/if}</td>
            <td><a href="{$site_admin}m=inventory&s=supplieProducts.php&uri=view&id={$products.id}">{$products.pname}</a> {$products.spec}</td>
             <td>{$products.shop_name}&nbsp;</td>
            <td>
            {if !empty($products.suppliers)}
            {foreach from=$products.suppliers item=supplier}
            	<p>{$supplier.title}({if $supplier.classid}{classes id=$supplier.classid}{$classes.title}{/classes}{else}未指定{/if})</p>
            {/foreach}
            {else}未指定{/if}
            </td>
            <td>{$products.pricebuy}&nbsp;</td>
            <td>{$products.currency_unit}&nbsp;</td>
            <td>{$products.stock}/{$products.stock_base_num}&nbsp;</td>
            <td>{if $products.is_default}是{else}否{/if}&nbsp;</td>
            <td>
            	{if "0"===$products.pc_status}<span style="color:gray">未送审</span>{/if}
                {if "-2"===$products.pc_status}<span style="color:orange">已送审</span>{/if}
                {if "1"===$products.pc_status}<span style="color:green">已上架</span>{/if}
                {if "2"===$products.pc_status}<span style="color:blue">推荐</span>{/if}
                {if "-1"===$products.pc_status}<span style="color:red">被驳回</span>{/if}
                {if "-3"===$products.pc_status||"-9"===$products.pc_status}<span style="color:#ccc">已下架</span>{/if}
            </td>
            <td>
            	{if "0"===$products.ms_status}<span style="color:gray">未送审</span>{/if}
                {if "-2"===$products.ms_status}<span style="color:orange">已送审</span>{/if}
                {if "1"===$products.ms_status}<span style="color:green">已上架</span>{/if}
                {if "2"===$products.ms_status}<span style="color:blue">推荐</span>{/if}
                {if "-1"===$products.ms_status}<span style="color:red">被驳回</span>{/if}
                {if "-3"===$products.ms_status||"-9"===$products.ms_status}<span style="color:#ccc">已下架</span>{/if}
            </td>
            <td>
            	{if "0"===$products.status}<span style="color:gray">未送审</span>{/if}
                {if "-2"===$products.status}<span style="color:orange">已送审</span>{/if}
                {if "1"===$products.status}<span style="color:green">已上架</span>{/if}
                {if "2"===$products.status}<span style="color:blue">推荐</span>{/if}
                {if "-1"===$products.status}<span style="color:red">被驳回</span>{/if}
                {if "-3"===$products.status||"-9"===$products.status}<span style="color:#ccc">已下架</span>{/if}
            </td>
            <td align="right">
            {rights right='products_remove'}<a href="{$site_admin}m=inventory&s=supplieProducts.php&uri=remove&id={$products.id}" onclick="return confirm('删除产品数据后不可恢复, 确定删除?')">删除</a>{/rights}
            {rights right='products_modify'}<a href="{$site_admin}m=inventory&s=supplieProducts.php&uri=modify&id={$products.id}">编辑</a>{/rights}
            </td>
          </tr>
      {/if} 
      {/supplieProducts}
      {if $pager->rows==0}
      <tr id="content">
        <td colspan="20" style="text-align: center;">&nbsp;暂无产品</td>
      </tr>
      {/if}
    </table>
    <div id="pager" class="mt10">
        {if $pager} 共{$pager->rows}条记录 第{$pager->pagecurrent}/{$pager->pages}页 {/if} 		
        {if $pager->current > 1}<a href="{url s1=1}">首页</a>{/if}
        {if $pager->current > 1}<a href="{url s1=$pager->current-1}">上页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->current+1}">下页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->pages}">尾页</a>{/if}
    </div>
    <p>&nbsp;</p>
    {rights right='products_create'}<ul id="addmenu"><li><a href="{$site_admin}m=inventory&s=supplieProducts.php&uri=create">添加一个新的产品信息</a></li></ul>{/rights}
</div>
{include file="admin/bottom.php"}
</body>
</html>
